<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Add a watch to an initialized inotify instance</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="ref.inotify.html">Inotify 函数</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.inotify-init.html">inotify_init</a></div>
 <div class="up"><a href="ref.inotify.html">Inotify 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.inotify-add-watch" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">inotify_add_watch</h1>
  <p class="verinfo">(PECL inotify &gt;= 0.1.2)</p><p class="refpurpose"><span class="refname">inotify_add_watch</span> &mdash; <span class="dc-title">Add a watch to an initialized inotify instance</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.inotify-add-watch-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>inotify_add_watch</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$inotify_instance</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$pathname</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$mask</code></span>
   )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>inotify_add_watch()</strong></span> adds a new watch or modify an
   existing watch for the file or directory specified in
   <em><code class="parameter">pathname</code></em>.
  </p>
  <p class="para">
   Using <span class="function"><strong>inotify_add_watch()</strong></span> on a watched object replaces
   the existing watch. Using the <strong><code>IN_MASK_ADD</code></strong> constant
   adds (OR) events to the existing watch.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.inotify-add-watch-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">inotify_instance</code></em></dt>

     <dd>

      <p class="para">
       <span class="function"><a href="function.inotify-init.html" class="function">inotify_init()</a></span>返回的资源
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">pathname</code></em></dt>

     <dd>

      <p class="para">
       File or directory to watch
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">mask</code></em></dt>

     <dd>

      <p class="para">
       Events to watch for. See <a href="inotify.constants.html" class="link">预定义常量</a>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.inotify-add-watch-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The return value is a unique (inotify instance wide) watch descriptor.
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.inotify-add-watch-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.inotify-init.html" class="function" rel="rdfs-seeAlso">inotify_init()</a> - Initialize an inotify instance</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="ref.inotify.html">Inotify 函数</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.inotify-init.html">inotify_init</a></div>
 <div class="up"><a href="ref.inotify.html">Inotify 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
